<?php
namespace app\admin\controller;
use think\Controller;
use think\Session;
use app\common\controller\Login;
use think\Request;
class Ht extends Login
{
	public function index()
	{
		
		return $this->fetch();
	}

	public function update()
	{
		$uid = session::get('admin');

		$this->assign('id',$uid);

		return $this->fetch();
	}

	public function do_uppwd()
	{
		$data = input('post.');
		
		$data['password'] = password_hash($data['password'], PASSWORD_DEFAULT);
		
		$static = db('user')->update($data);

		if ($static) {
			return $this->redirect('admin/index/index');
		}
	}
	

	public function logout()
	{
		session::delete('admin');

		return $this->redirect('admin/index/index');
	}

	
}
